#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    char* s;
    scanf("%s",s);
    int a = 0, b = 0, c = 0, i = 0;
    for (i = 0; s[i] != '\0'; i++)
    {
        if (s[i] >= '0' && s[i] <= '9' && a == 0)
            a++;
        if (s[i] >= 'a' && s[i] <= 'z' && b == 0)
            b++;
        if (s[i] >= 'A' && s[i] <= 'Z' && c == 0)
            c++;
    }
    if (s[0] >= '0' && s[0] <= '9' || i <= 8)
        printf("NO");
    else
    {
        if (a + b + c < 2)
            printf("NO");
        else
            printf("YES");
    }

    return 0;
}